#! /bin/bash

key="$1"
count="$2"

if test -z "$key"; then
    echo "key name required"
    exit 1
fi

if test -z "$count"; then
    echo "count required"
    exit 1
fi

now=`date +%s%N`
stash=`expr "$now" - 1`

redis-cli --eval ./dequeue.lua "$key-stash" "$key-queue" , "$stash" "$count"
